package com.example.design.behavior.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * \* @author: bear
 * \* Date: 2021-01-26-16:03
 * \* describe:记者是观察者
 */
public class Author implements Observer {
	private String AuthorName;

	public Author(String authorName) {
		AuthorName = authorName;
	}
	//发布
	@Override
	public void update(Observable o, Object arg) {
		News news =(News) o;
		Reader reader = (Reader) arg;
		System.out.println(AuthorName+"在后台看到了:"+news.getTitle()+news.getContent());
	}
}
